

function showPieChart(index){
	var data;
	if(index == 1){
		data = [
		    {value:43, name:'已用'},
		    {value:2, name:'未用'}
		]
	}else{
		data = [
		    {value:40, name:'已用'},
		    {value:5, name:'未用'}
		]
	}
	var myEcharts = echarts.init(document.getElementById('echart'+index));
	var option = {
		title:{
			text:'机房使用率'
		},
	    tooltip : {
	        trigger: 'item',
	        formatter: "{a} <br/>{b} : {c} ({d}%)"
	    },
	    legend: {
	        orient: 'horizontal',
	        top: 'bottom',
	        data: ['已用','未用']
	    },
	    color:['#4acacb','#fc8675'],
	    series : [
	        {
	            name: '机房使用率',
	            type: 'pie',
				startAngle:60,
	            data:data,
	            itemStyle: {
	                emphasis: {
	                    shadowBlur: 10,
	                    shadowOffsetX: 0,
	                    shadowColor: 'rgba(0, 0, 0, 0.5)'
	                }
	            },
	            label:{
	                formatter:'{b}:\t{c}\n{d}%',
					backgroundColor: '#eee',
					borderColor: '#aaa',
					borderWidth: 1,
					borderRadius: 4,
					padding: 5,
					rich: {
						b: {
							fontSize: 16,
							lineHeight: 33
						}
					}
	            }
	        }
	    ]
	};
	myEcharts.setOption(option);
}